
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <select id="province" onchange="func1(this)" >
    </select>
    <select id="city"></select>
</body>
<script>
    // data = {"广东省":["广州","佛山"],"北京":["海淀","廊坊"], "海南省":["三亚","海口"],"山东":['菏泽',"青岛","临沂"]};
    // var pro  = document.getElementById("province");
    // var city = document.getElementById("city");

    // for (var i in data){
    //     var option_pro = document.createElement("option");
    //     option_pro.innerHTML=i;
    //     pro.appendChild(option_pro);
    // }

    // function func1(self){
    //     //console.log((self.options[self.selectedIndex]).innerHTML);
    //     var choice = (self.options[self.selectedIndex]).innerHTML;

    //     var options = city.children;
    //     for (var k=0; k<options.length; k++){
    //         city.removeChild(options[k--]);
    //     }

    //     for (var i in data[choice]){
    //         var option_city = document.createElement("option");
    //         option_city.innerHTML = data[choice][i];
    //         city.appendChild(option_city);
    //     }
    // }

    var str='https://www.w3school.com.cn/jsref/jsref_obj_regexp.asp'

var red= /\d/g
console.log(red.exec(str));
console.log(red.test(str));



console.log(str.search(red));
console.log(str.match(red));
console.log(str.replace(red,'*'));
console.log(str.split(red));
</script>

</html>